package com.fui.controller;

import com.alibaba.fastjson.JSON;
import com.fui.domain.SmbmsRole;
import com.fui.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@RequestMapping("/role")
@Controller
public class RoleController {

    @Autowired
    private RoleService roleService;

    @ResponseBody
    @GetMapping(value = "/queryRole", produces = "application/json;charset=UTF-8")
    public String queryRole() {
        List<SmbmsRole> roles = roleService.queryRole();
//        return JSON.toJSONString(roles, true);

        return JSON.toJSONString(roles);
    }

}
